# Copyright (C) 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
    name = "go_default_library",
    srcs = [
        "device.go",
        "device_listener.go",
        "doc.go",
        "job.go",
        "local.go",
        "manager.go",
        "remote.go",
        "server.go",
    ],
    embed = [":job_go_proto"],
    importpath = "github.com/google/gapid/test/robot/job",
    visibility = ["//visibility:public"],
    deps = [
        "//core/app/crash:go_default_library",
        "//core/event:go_default_library",
        "//core/log:go_default_library",
        "//core/net/grpcutil:go_default_library",
        "//core/os/android/adb:go_default_library",
        "//core/os/device:go_default_library",
        "//core/os/device/bind:go_default_library",
        "//core/os/device/host:go_default_library",
        "//test/robot/record:go_default_library",
        "//test/robot/search:go_default_library",
        "//test/robot/search/eval:go_default_library",
        "@org_golang_google_grpc//:go_default_library",
        "@org_golang_x_net//context:go_default_library",
    ],
)

proto_library(
    name = "job_proto",
    srcs = ["job.proto"],
    visibility = ["//visibility:public"],
    deps = [
        "//core/os/device:device_proto",
        "//test/robot/search:search_proto",
    ],
)

go_proto_library(
    name = "job_go_proto",
    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
    importpath = "github.com/google/gapid/test/robot/job",
    proto = ":job_proto",
    visibility = ["//visibility:public"],
    deps = [
        "//core/os/device:go_default_library",
        "//test/robot/search:go_default_library",
    ],
)
